package com.wanmait.gohome.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wanmait.gohome.mapper.ClueMapper;
import com.wanmait.gohome.mapper.CommentMapper;
import com.wanmait.gohome.pojo.Clue;
import com.wanmait.gohome.service.ClueService;
import com.wanmait.gohome.util.SysContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;


@Service
@Transactional
public class ClueServiceImpl implements ClueService {
    @Resource
    private ClueMapper clueMapper;
    @Override
    public void insert(Clue object) {

    }

    @Override
    public void insertClue(Clue clue) {
        clueMapper.insertClue(clue);
    }


    @Override
    public void update(Integer id) {
    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public List<Clue> findAll() {
        return null;
    }

    @Override
    public Clue findById(Integer id) {
        return null;
    }

    @Override
    public PageInfo<Clue> findPage() {
        return null;
    }

    @Override
    public List<Clue> findAll(Clue object) {
        return null;
    }

    @Override
    public PageInfo<Clue> findPage(Clue object) {
        return null;
    }

    @Override
      public PageInfo<Clue> findAllById(int id) {
        int pageNum = SysContext.getPageNum();
        int pageSize = 5;
        PageHelper.startPage(pageNum, pageSize);
        List<Clue> clues = (List<Clue>) clueMapper.findAlls(id);
        PageInfo<Clue> pageInfo = new PageInfo<>(clues, 3);
        return pageInfo;
    }
}
